{include file="head" title="内容修改" /}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">
            MRO大数据
            <input class="layui-btn layui-btn-sm layui-btn-normal" type="button" id="full_screen_open" value="打开大屏"/>
        </div>
        <div class="layui-layout-body" style="padding: 15px;height: auto">
            <iframe id="container" src="https://datav.aliyun.com/share/f93cfef28b2af5a891c0dd1996373973" frameborder="0" style="width: 100%;height: 800px;"></iframe>
        </div>
    </div>
</div>

<script>
    function setIframeHeight(iframe) {
        if (iframe) {
            var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
            if (iframeWin.document.body) {
                iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
            }
        }
    };

    window.onload = function () {
        setIframeHeight(document.getElementById('container'));
    };

    layui.config({
        base: '{$Think.const.admin_tpl}/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'upload', 'laydate'], function () {
        var $ = layui.$
            , layer = layui.layer
            , laydate = layui.laydate
            , upload = layui.upload
            , form = layui.form,
            requestFullScreen = function(element) {
            var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
            if (requestMethod) {
                requestMethod.call(element);
            } else if (typeof window.ActiveXObject !== "undefined") {
                var wscript = new ActiveXObject("WScript.Shell");
                if (wscript !== null) {
                    wscript.SendKeys("{F11}");
                }
            }
        };

        $("#full_screen_open").on("click",function(){
            console.log(requestFullScreen);
            requestFullScreen($("#container")['0']);
        });
    });

</script>
{include file="foot" /}
